home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / FABS.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  313 b   |  16 lines

  1. /* fabs.c function,  from p.210 of turbo c bilbe */
  2. #include<stdio.h>
  3. #include<math.h>
  4. main(int argc, char **argv)
  5. {
  6.     double result;
  7.     if(argc < 2)
  8.     {
  9.         printf("Usage %s <value>\n", argv[0]);
  10.     }
  11.     else
  12.     {
  13.         result = fabs(atof(argv[1]));
  14.         printf("abslute value of %s = %f \n", argv[1], result);
  15.     }
  16. }